home *** CD-ROM | disk | FTP | other *** search
- on PlayVoice
- global voicePath, currentVoice
- sound stop 1
- if currentVoice = EMPTY then
- exit
- end if
- sound playFile 1, voicePath & currentVoice
- end
-
- on PlaySoundTrack
- global soundTrackPath, currentsoundTrack
- if soundBusy(2) then
- exit
- end if
- sound playFile 2, soundTrackPath & currentsoundTrack
- end
-
- on ToggleVolumeWindow
- global vWindow, vSlider1, vSlider2, volumeHPositions
- if the left of sprite vWindow > 641 then
- set the locH of sprite vWindow to value(item 1 of volumeHPositions)
- set the locH of sprite vSlider1 to value(item 2 of volumeHPositions)
- set the locH of sprite vSlider2 to value(item 3 of volumeHPositions)
- updateStage()
- else
- set the locH of sprite vWindow to 12000
- set the locH of sprite vSlider1 to 12000
- set the locH of sprite vSlider2 to 12000
- updateStage()
- end if
- end
-
- on dragSlider whichOne
- global sliderTop, sliderBottom
- set vOffset to the locV of sprite whichOne - the mouseV
- repeat while the stillDown
- if (the mouseV >= sliderTop) and (the mouseV <= sliderBottom) then
- set the locV of sprite whichOne to the mouseV + vOffset
- updateStage()
- end if
- end repeat
- SetSliderLevel(whichOne)
- end
-
- on SetSliderVolume whichChannel
- global sliderTop, sliderBottom, vSlider1, vSlider2, ambientLevel, voiceLevel
- if whichChannel = vSlider1 then
- set channelNum to 1
- else
- set channelNum to 2
- end if
- set volumeTop to 255
- set range to sliderBottom - sliderTop
- set howLoud to the volume of sound channelNum
- set the locV of sprite whichChannel to sliderBottom - integer(range * howLoud / volumeTop)
- updateStage()
- end
-
- on SetSliderLevel whichSlider
- global sliderTop, sliderBottom, vSlider1, vSlider2, ambientLevel, voiceLevel
- set range to sliderBottom - sliderTop
- set where to sliderBottom - the locV of sprite whichSlider
- set where to float(where) / range
- set sliderV to integer(where * 255)
- if whichSlider = vSlider1 then
- set the volume of sound 1 to sliderV
- set voiceLevel to sliderV
- else
- set the volume of sound 2 to sliderV
- set ambientLevel to sliderV
- end if
- updateStage()
- end
-
- on keyCheck
- if the key = " " then
- ToggleVolumeWindow()
- end if
- end
-
- on soundSetup
- global voicePath, soundTrackPath, currentVoice, currentsoundTrack, vWindow, vSlider1, vSlider2, sliderTop, sliderBottom, volumeHPositions, ambientLevel, voiceLevel
- set vWindow to 46
- set vSlider1 to 47
- set vSlider2 to 48
- set sliderTop to the top of sprite vWindow + 26
- set sliderBottom to the bottom of sprite vWindow - 32
- set volumeHPositions to "320,302,338"
- set the volume of sound 2 to ambientLevel
- set the volume of sound 1 to voiceLevel
- SetSliderVolume(vSlider1)
- SetSliderVolume(vSlider2)
- when keyDown then keyCheck
- end
-
- on ClearPuppets
- repeat with i = 1 to 44
- puppetSprite(i, 0)
- end repeat
- end
-
- on stopMovie
- global gFlyThru, gCraftBefore
- repeat with i = 1 to 40
- puppetSprite(i, 0)
- end repeat
- set gFlyThru to 2
- set gCraftBefore to 0
- set the timeoutScript to "nothing"
- ClearPuppets()
- sound stop 1
- sound fadeOut 2, 1 * 60
- sound fadeIn 2, 1 * 60
- end
-
- on NextScreen
- ClearPuppets()
- sound stop 1
- unLoad()
- set lFrame1 to marker(1)
- set lFrame2 to marker(2) - 1
- preLoad(lFrame1, lFrame2)
- end
-
- on EndOfSceneFrame lFrame
- global gWaitForUser
- if gWaitForUser = 0 then
- go(the frame)
- else
- if soundBusy(1) = 1 then
- go(the frame)
- else
- NextScreen()
- go(lFrame)
- end if
- end if
- end
-
- on EndOfScene
- global gWaitForUser
- if gWaitForUser = 0 then
- go(the frame)
- else
- if soundBusy(1) = 1 then
- go(the frame)
- else
- NextScreen()
- go(marker(1))
- end if
- end if
- end
-
- on EndOfSceneWithLoop
- global gWaitForUser
- if (the frame + 1) = marker(1) then
- if gWaitForUser = 0 then
- go(marker(0) + 1)
- else
- if soundBusy(1) = 1 then
- go(marker(0) + 1)
- else
- NextScreen()
- go(marker(1))
- end if
- end if
- else
- if gWaitForUser = 0 then
- go(the frame + 1)
- else
- if soundBusy(1) = 1 then
- go(the frame + 1)
- else
- NextScreen()
- go(marker(1))
- end if
- end if
- end if
- end
-
- on EndOfSceneWithLoopMovie lmovie
- global gWaitForUser
- if (the frame + 1) = marker(1) then
- if gWaitForUser = 0 then
- go(marker(0) + 1)
- else
- if soundBusy(1) = 1 then
- go(marker(0) + 1)
- else
- ClearPuppets()
- puppetSprite(45, 0)
- go(1, lmovie)
- end if
- end if
- else
- if gWaitForUser = 0 then
- go(the frame + 1)
- else
- if soundBusy(1) = 1 then
- go(the frame + 1)
- else
- ClearPuppets()
- puppetSprite(45, 0)
- go(1, lmovie)
- end if
- end if
- end if
- end
-
- on EndOfSceneFinal
- global gWaitForUser
- if gWaitForUser = 0 then
- go(the frame)
- else
- if soundBusy(1) = 1 then
- go(the frame)
- else
- NextScreen()
- go("enter", "Main")
- end if
- end if
- end
-
- on EndOfSceneFinalWithLoop
- global gWaitForUser
- if (the frame + 1) = marker(1) then
- if gWaitForUser = 0 then
- go(marker(0) + 1)
- else
- if soundBusy(1) = 1 then
- go(marker(0) + 1)
- else
- ClearPuppets()
- puppetSprite(45, 0)
- go("Enter", "Main")
- end if
- end if
- else
- if gWaitForUser = 0 then
- go(the frame + 1)
- else
- if soundBusy(1) = 1 then
- go(the frame + 1)
- else
- ClearPuppets()
- puppetSprite(45, 0)
- go("Enter", "Main")
- end if
- end if
- end if
- end
-
- on EndOfSceneMovie lmovie
- global gWaitForUser
- if gWaitForUser = 0 then
- go(the frame)
- else
- if soundBusy(1) = 1 then
- go(the frame)
- else
- ClearPuppets()
- puppetSprite(45, 0)
- go(1, lmovie)
- end if
- end if
- end
-
- on NextScreenFrame lFrame
- ClearPuppets()
- sound stop 1
- unLoad()
- set lFrame1 to lFrame
- go(lFrame)
- set lFrame2 to marker(1) - 1
- preLoad(lFrame1, lFrame2)
- end
-
- on EndOfSceneWithQT lSpriteNumber
- global gWaitForUser
- if the movieTime of sprite lSpriteNumber < the stopTime of sprite lSpriteNumber then
- go(the frame)
- exit
- else
- if gWaitForUser = 0 then
- go(the frame)
- else
- NextScreen()
- set the movieTime of sprite lSpriteNumber to 0
- set the movieRate of sprite lSpriteNumber to 0
- go(marker(1))
- end if
- end if
- end
-
- on ResetQT lSpriteNumber
- set the movieTime of sprite lSpriteNumber to 0
- set the movieRate of sprite lSpriteNumber to 0
- end
-
- on EndOfSceneMovieWithQT lSpriteNumber, lmovie
- global gWaitForUser
- if the movieTime of sprite lSpriteNumber < the stopTime of sprite lSpriteNumber then
- go(the frame)
- exit
- else
- if gWaitForUser = 0 then
- go(the frame)
- else
- NextScreen()
- set the movieTime of sprite lSpriteNumber to 0
- set the movieRate of sprite lSpriteNumber to 0
- ClearPuppets()
- puppetSprite(45, 0)
- go(1, lmovie)
- end if
- end if
- end
-
- on waitNew lamount
- startTimer()
- repeat while the timer < (lamount * 60)
- nothing()
- end repeat
- end
-
- on checkDOS SoundFileName
- set x to offset(".", SoundFileName)
- put "Sound name:" && SoundFileName && " Name length =" && string(x - 1)
- if x > 9 then
- alert("Name too long")
- end if
- end
-
- on checkColor
- repeat with x = 1 to 1200
- if the castType of cast x = #bitmap then
- if the depth of cast x > 8 then
- alert("Crummy Cast" && "at cast" && string(x))
- end if
- end if
- end repeat
- end
-
- on checkInks
- repeat with x = 1 to 30
- set i to the ink of sprite x
- if i <> 0 then
- put "sprite" && x && "uses ink effect:" && i
- end if
- end repeat
- end
-